﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Brjostagjof.Models.AdminViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjóstagjöf - Administrator
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Admin</h2>
    <div id="adminTable">
        <% if (Model.UserInfoList.Count() == 0)
           { %>
           <p> Enginn notandi hefur óskað eftir að gerast fagaðili að svo stöddu. </p>
        <% }
           else
           { %>
            <% using (Html.BeginForm("GeraFagadila","Home", FormMethod.Post) )
               { %>
                <label for="fagadili"> Gera notanda að fagaðila</label>
                    <%: Html.DropDownListFor(model => model.User.UserId, new SelectList(Model.UserInfoList, "UserId", "FullName"), new { @selected = "Enginn valinn" })%>
                    <%: Html.LabelFor(model => model.isDenied)%>
                    <%: Html.CheckBoxFor(model => model.isDenied)%>
                <input type="submit" value="Gera að fagaðila" />
            <%} %>
        <%} %>
        <br />
        <% Html.RenderPartial("PartialViews/AdminMostReadArticles", Model); %>
        <br />
        <div>
            <h2>Eyddar Fréttagreinar</h2>
            <% foreach (var newsArticle in Model.deletedNewsArticles)
               { %>
                    <p><%: newsArticle.Title %></p>
            <%} %>
        </div>
        <br />
        <div>
            <h2>Eyddar Greinar</h2>
            <% foreach (var article in Model.deletedArticles)
               { %>
                    <p><%: article.Title %></p>
            <%} %>
        </div> 
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="Actions" runat="server">
    <% Html.RenderPartial("PartialViews/Actions", "Admin"); %>
</asp:Content>
